package com.qiangqiang.taskuser.util;

import com.qiangqiang.taskuser.vo.ResultVO;

/**
 * @author : sky
 * @date : 2018/7/11
 * @description :
 */
public class ResultVOUtil {
    /**
      * @author sky
      * @date 2018/7/11
      * @param [object]
      * @return com.qiangqiang.taskuser.vo.ResultVO
      * @describe:
      *  封装成功返回数据
     */
    public static ResultVO success(Object object){
        ResultVO resultVO=new ResultVO();
        resultVO.setData(object);
        resultVO.setMsg("成功");
        resultVO.setCode(0);
        return resultVO;
    }
    public static ResultVO success(){
        return success(null);
    }
    /**
      * @author sky
      * @date 2018/7/11
      * @param [code, msg]
      * @return com.qiangqiang.taskuser.vo.ResultVO
      * @describe:
      *  封装失败返回数据
     */
    public static ResultVO error(Integer code, String msg){
        ResultVO resultVO=new ResultVO();
        resultVO.setCode(code);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
